package com.lanou.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lanou.bean.T8TFurnitureCommodityBean;
import com.lanou.mapper.T8TFurnitureCommodityMapper;
import com.lanou.service.T8TFurnitureCommodityService;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by dllo on 18/3/19.
 */
@Service
public class T8TFurnitureCommodityServiceImpl implements T8TFurnitureCommodityService {


    @Resource
    private T8TFurnitureCommodityMapper t8TFurnitureCommodityMapper;

    @Override
    public PageInfo<T8TFurnitureCommodityBean> findFurnitureCommodity(String classifyRoom,Integer pageNum, Integer pageSize) {
        pageNum=pageNum==null?1:pageNum;
        pageSize=pageSize==null?11:pageSize;
        PageHelper.startPage(pageNum,pageSize);
        List<T8TFurnitureCommodityBean> list=t8TFurnitureCommodityMapper.findFurnitureCommodity(classifyRoom);
        PageInfo<T8TFurnitureCommodityBean> pageInfo=new PageInfo<T8TFurnitureCommodityBean>(list);
        return pageInfo;
    }
}
